#pragma once

#include "Hazel.h"
class Sandbox2D : public Hazel::Layer
{
  public:
    Sandbox2D();
    virtual ~Sandbox2D() = default;
    virtual void OnAttach() override;
    virtual void OnDetach() override;
    void OnUpdate(Hazel::Timestep ts) override;
    virtual void OnImGuiRender() override;
    void OnEvent(Hazel::Event &e) override;

  private:
    Hazel::OrthographicCameraController m_CameraController;

    // temp
    Hazel::Ref<Hazel::VertexArray> m_SquareVA;
    Hazel::Ref<Hazel::Shader> m_FlatColorShader;

    Hazel::Ref<Hazel::Texture2D> m_CheckboardTexture;
    Hazel::Ref<Hazel::Texture2D> m_SpriteSheet;
    Hazel::Ref<Hazel::SubTexture2D> m_TextureFlag,m_TextureTree;

    struct ProfileResult
    {
        const char *name;
        float time;
    };

    std::vector<ProfileResult> m_ProfileResults;
    glm::vec4 m_SquareColor = {0.2f, 0.3f, 0.8f, 1.0f};
    std::unordered_map<char, Hazel::Ref<Hazel::SubTexture2D>> m_MapElement;
};